import Vue from 'vue';
import App from './App.vue';
//导入路由
import vueRouter from 'vue-router';
Vue.use(vueRouter);
//导入mint-ui
import mintUi from 'mint-ui';
import 'mint-ui/lib/style.min.css';
Vue.use(mintUi);
//导入mui的css
import '../statics/mui/css/mui.css';
import '../statics/mui/css/icons-extra.css';
//导入全局css
import '../statics/css/site.css';
//导入vue-resource
import vueResource from 'vue-resource';
Vue.use(vueResource);
//导入vue-preview
import vuePreview from 'vue-preview';
Vue.use(vuePreview);
//导入组件
import home from './components/Home.vue';
import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';
import photograph from './components/photo/photograph.vue';
import photoinfo from './components/photo/photoinfo.vue';
import goodslist from './components/goods/goodslist.vue';
import goodsinfo from './components/goods/goodsinfo.vue';
import goodscomment from './components/goods/goodscomment.vue';
import goodsdesc from './components/goods/goodsdesc.vue';

import account from './components/account/account.vue';



import shopcar from './components/shopcar/shopcar.vue';






var router = new vueRouter({
    linkActiveClass: 'mui-active',
    routes: [{
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: home
        },
        {
            path: '/account',
            component: account
        },
        {
            path: '/news/newslist',
            component: newslist
        }, {
            path: '/news/newsinfo/:id',
            component: newsinfo
        },
        {
            path: '/photo/photograph',
            component: photograph
        },
        {
            path: '/photo/photoinfo/:id',
            component: photoinfo
        },
        {
            path: '/goods/goodslist',
            component: goodslist
        },
        {
            path: '/goods/goodsinfo/:id',
            component: goodsinfo
        },
        {
            path: '/goods/goodsdesc/:id',
            component: goodsdesc
        },
        {
            path: '/goods/goodscomment/:id',
            component: goodscomment
        },
        {
            path: '/shopcar',
            component: shopcar
        },

    ]
});

//定义全局日期格式化过滤器
import moment from 'moment';
Vue.filter('datefmt', function(input, fmt) {
    return moment(input).format(fmt);
})

new Vue({
    el: '#app',
    router: router,
    render: c => c(App)
});